home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 422 < prev    next >
Internet Message Format  |  1996-08-06  |  2KB

  1. Path: solon.com!not-for-mail
  2. From: danpop@mail.cern.ch (Dan Pop)
  3. Newsgroups: comp.std.c,comp.lang.c.moderated
  4. Subject: Re: Integral promotion.
  5. Date: 17 Feb 1996 12:18:37 -0600
  6. Organization: CERN European Lab for Particle Physics
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4g565t$bam@solutions.solon.com>
  10. References: <4fstj7$2l6@solutions.solon.com> <4fu835$9de@solutions.solon.com> <4fvgrm$dv9@solutions.solon.com> <4g27gn$q5k@solutions.solon.com>
  11. NNTP-Posting-Host: solutions.solon.com
  12. X-Newsreader: NN version 6.5.0 #7 (NOV)
  13.  
  14. In <4g27gn$q5k@solutions.solon.com> Chris Torek <torek@elf.bsdi.com> writes:
  15.  
  16. :In article <4fvgrm$dv9@solutions.solon.com>,  <msb@sq.com> wrote:
  17. :
  18. :>Excerpts from the standard:
  19. :>
  20. :>*  From 6.3.16.1/3.3.16.1:
  21. :>#  In "simple assignment" (=), the value of the right operand is
  22. :>#  converted to the type of the left operand ...
  23. :>
  24. :>*  From 6.2.1.2/3.2.1.2:
  25. :>#  When a value with integral type is demoted to a signed integer with
  26. :>#  smaller size ... if the value cannot be represented the result is
  27. :>#  implementation-defined.                             ^^^^^^^^^^^^^
  28. :>   ^^^^^^^^^^^^^^^^^^^^^^
  29. :>Hence implementation-defined behavior occurs.
  30. :
  31. :Thus, the implementation has to say exactly how it handles this.
  32. :There is still some question as to whether the implementation can
  33. :define it as an overflow resulting in program termination, is there
  34. :not?
  35.  
  36. This is open to debate.  According to the standard, the result of the
  37. conversion is implementation-defined, not the behaviour of the program.
  38.  
  39. Dan
  40. --
  41. Dan Pop
  42. CERN, CN Division
  43. Email: danpop@mail.cern.ch 
  44. Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  45.